package com.jbm.jbmsupplier.view;

import android.app.AlertDialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.jbm.jbmsupplier.R;


/**
 * Created by 家帮忙 on 2017/9/18.
 */

public class DialoagButtonLoading {
    private final TextView xiugainamest;
    private final Button buttquedingt;
    private final Button buttquxiaot;
    private final EditText editnamet;
    private final AlertDialog al;
    private Context context;
    private DialogLoading dialogLoadingt;
    public DialoagButtonLoading(Context context) {
        this.context = context;
         al = new AlertDialog.Builder(context).create();
        al.setCancelable(false);
        View view = View.inflate(context, R.layout.dialogname_lzyout, null);
        al.setView(view);
         xiugainamest= (TextView) view.findViewById(R.id.xiugainames);
         buttquedingt = (Button) view.findViewById(R.id.buttqueding);
         buttquxiaot = (Button) view.findViewById(R.id.buttquxiao);
         editnamet = (EditText) view.findViewById(R.id.editname);
    }
    public void shows(){
        if (al!=null){
            al.show();
        }
    }
    public void disimm(){
        if (al!=null){
            al.dismiss();
        }
    }


    public TextView getTitlename(){
        return xiugainamest;
    }
    public EditText getEditname(){
        return editnamet;
    }

    public View froButton(){
        return buttquedingt;
    }

   public View toButton(){
     return buttquxiaot;
  }


    //一些提示的时候调用
    public void hint( String name) {
        final DoubleButtonDialog dialogs = new DoubleButtonDialog(context, name);
        dialogs.getokbtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialogs.dismiss();
            }
        });
        dialogs.setisVisibility();

    }
public void Loadingshow(String name,boolean boo){
     dialogLoadingt = new DialogLoading(context, name, boo);
    dialogLoadingt.show();
}
public void disims(){
    dialogLoadingt.dismiss();

}



}
